package com.example.administrator.myapplication;

import javax.inject.Inject;

/**
 * Created by Administrator on 2017/6/6.
 */
public class SimpleMaker implements CoffeeMaker {

    Cooker cooker;  //现在需要咖啡师来制作咖啡了

    public SimpleMaker(){
    }

    @Inject
    public SimpleMaker(Cooker cooker){
        this.cooker = cooker;
    }

    @Override
    public String makeCoffee() {

        if (cooker != null) {
            return cooker.make();
        }
        return "SimpleMaker.makeCoffee";
    }
}
